//
//  MKTChatMsgTVCellBase.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2021/7/8.
//  Copyright © 2021 moon. All rights reserved.
//

#import "MKTChatMsgTVCellBase.h"

@implementation MKTChatMsgTVCellBase
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = [UIColor clearColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}
- (MKTChatMsgBase *)chatMsg{
    return self.cellModel.modelValue;
}
@end

NSString *const kMKTChatMsgRegisterCategory=@"kMKTChatMsgRegisterCategory";
@implementation MKTChatMsgBase(MKTRegisterManager)
- (Class)tableViewCellClass{
    NSString *key = NSStringFromClass(self.class);
    Class cellClass = [[MKTRegisterManager sharedInstance] valueRegistedForKey:key category:kMKTChatMsgRegisterCategory];
    return cellClass;
}
@end

@implementation MKTChatMsgTVCellBase(MKTRegisterManager)
+ (void)registerTableViewCellFor:(Class)aClass{
    MKTRegisterOption *option = [[MKTRegisterOption alloc] initWithKey:NSStringFromClass(aClass) value:self.class priority:kMKTRegisterPriotiryDefault];
    [[MKTRegisterManager sharedInstance] registerOption:option forCategory:kMKTChatMsgRegisterCategory];
}
@end
